﻿/*
#**************************************************************************
#  openSIS is a student information system for public and non-public 
#  schools from Open Solutions for Education, Inc. web: www.os4ed.com
#
#  openSIS is  web-based, open source, and comes packed with features that 
#  include student demographic info, scheduling, grade book, attendance, 
#  report cards, eligibility, transcripts, parent portal, 
#  student portal and more.   
#
#  Visit the openSIS web site at http://www.opensis.com to learn more.
#  If you have question regarding this system or the license, please send 
#  an email to info@os4ed.com.
#
#  This program is released under the terms of the GNU General Public License  
#  as  published by the Free Software Foundation, version 2 of the License. 
#  See license.txt.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#**************************************************************************** 
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using System.Data;
using OpenSIS.OpenSISWCFServiceReference;

namespace OpenSISStaffDropDownList
{
    public class StaffDropDown
    {
        public void PopulateSalutation(ref DropDownList ddl)
        {
            ddl.Items.Clear();
            ddl.Items.Insert(0, new ListItem("Select", "0"));
            ddl.Items.Insert(1, new ListItem("Dr.", "1"));
            ddl.Items.Insert(2, new ListItem("Mr.", "2"));
            ddl.Items.Insert(3, new ListItem("Ms.", "3"));
            ddl.Items.Insert(4, new ListItem("Mrs.", "4"));
            ddl.Items.Insert(5, new ListItem("Rev.", "5"));
            ddl.Items.Insert(6, new ListItem("Miss.", "6"));
        }

        public void PopulateSuffix(ref DropDownList ddl)
        {
            ddl.Items.Clear();
            ddl.Items.Insert(0, new ListItem("Select", "0"));
            ddl.Items.Insert(1, new ListItem("Jr.", "1"));
            ddl.Items.Insert(2, new ListItem("Sr.", "2"));
            ddl.Items.Insert(3, new ListItem("I", "3"));
            ddl.Items.Insert(4, new ListItem("II", "4"));
            ddl.Items.Insert(5, new ListItem("III", "5"));
            ddl.Items.Insert(6, new ListItem("IV", "6"));
        }

        public void PopulateRelationShip(ref DropDownList ddl)
        {
            ddl.Items.Clear();
            ddl.Items.Insert(0, new ListItem("Select", "0"));
            ddl.Items.Insert(1, new ListItem("Spouse", "1"));
            ddl.Items.Insert(2, new ListItem("Mother", "2"));
            ddl.Items.Insert(3, new ListItem("Father", "3"));
            ddl.Items.Insert(4, new ListItem("Brother", "4"));
            ddl.Items.Insert(5, new ListItem("Sister", "5"));
            ddl.Items.Insert(6, new ListItem("Son", "6"));
            ddl.Items.Insert(7, new ListItem("Daughter", "7"));
            ddl.Items.Insert(8, new ListItem("Partner", "8"));
            ddl.Items.Insert(9, new ListItem("Friend", "9"));
            ddl.Items.Insert(10, new ListItem("Other", "10"));
        }

        public void PopulateStatus(ref DropDownList ddl)
        {
            ddl.Items.Clear();
            ddl.Items.Insert(0, new ListItem("Select", "0"));
            ddl.Items.Insert(1, new ListItem("Active", "1"));
            ddl.Items.Insert(2, new ListItem("Inactive", "2"));
        }

        public void PopulateLibraryClass(ref DropDownList ddl)
        {
            ddl.Items.Clear();
            ddl.Items.Insert(0, new ListItem("Select", "0"));
            ddl.Items.Insert(1, new ListItem("All", "1"));
            ddl.Items.Insert(2, new ListItem("Adult", "2"));
            ddl.Items.Insert(3, new ListItem("Child", "3"));
            ddl.Items.Insert(4, new ListItem("Adoloscent", "4"));
        }

        public void PopulateSecretquestion(ref DropDownList ddl)
        {            
            ddl.Items.Clear();
            ddl.Items.Insert(0, new ListItem("Select", "0"));
            ddl.Items.Insert(1, new ListItem("What is your pet's name?", "1"));
            ddl.Items.Insert(2, new ListItem("What is your mother's maiden name?", "2"));
            ddl.Items.Insert(3, new ListItem("What is your favourite holiday destination?", "3"));
            ddl.Items.Insert(4, new ListItem("What is your favourite festival?", "4"));
            ddl.Items.Insert(5, new ListItem("Where did you meet your spouse ?", "5"));
        }

        public void PopulateEthnicity(ref DropDownList ddl,int SchID)
        {
            OpenSISWCFServiceStaffClient OSClient = new OpenSISWCFServiceStaffClient();
            ddl.Items.Clear();
            DataSet ds = null;
            ds = OSClient.PopulateEthnicity(SchID);
            OSClient.Close();
            ddl.DataSource = ds.Tables[0];
            ddl.DataTextField = "eth_nm";
            ddl.DataValueField = "eth_id";
            ddl.DataBind();
            ddl.Items.Insert(0, new ListItem("Select", "0"));            
        }
        public void PopulateLanguage(ref DropDownList ddl)
        {
            OpenSISWCFServiceStaffClient OSClient = new OpenSISWCFServiceStaffClient();
            ddl.Items.Clear();
            DataSet ds = null;
            ds = OSClient.PopulateLanguage();
            OSClient.Close();
            ddl.DataSource = ds.Tables[0];
            ddl.DataTextField = "language_nm";
            ddl.DataValueField = "language_id";
            ddl.DataBind();
            ddl.Items.Insert(0, new ListItem("Select", "0"));
        }
        public void PopulateState(ref DropDownList ddl)
        {
            OpenSISWCFServiceStaffClient OSClient = new OpenSISWCFServiceStaffClient();
            ddl.Items.Clear();
            DataSet ds = null;
            ds = OSClient.PopulateState();
            OSClient.Close();
            ddl.DataSource = ds.Tables[0];
            ddl.DataTextField = "NAME";
            ddl.DataValueField = "IID";
            ddl.DataBind();
            ddl.Items.Insert(0, new ListItem("Select", "0"));
        }
        public void PopulateStaffType(ref DropDownList ddl)
        {
            OpenSISWCFServiceStaffClient OSClient = new OpenSISWCFServiceStaffClient();
            ddl.Items.Clear();
            DataSet ds = null;
            ds = OSClient.PopulateStaffType();
            OSClient.Close();
            ddl.DataSource = ds.Tables[0];
            ddl.DataTextField = "stf_type_name";
            ddl.DataValueField = "stf_type_cd";
            ddl.DataBind();
            ddl.Items.Insert(0, new ListItem("Select", "0"));
        }
        public void PopulateSchools(ref DropDownList ddl)
        {
            OpenSISWCFServiceStaffClient OSClient = new OpenSISWCFServiceStaffClient();
            ddl.Items.Clear();
            DataSet ds = null;
            ds = OSClient.PopulateSchools();
            OSClient.Close();
            ddl.DataSource = ds.Tables[0];
            ddl.DataTextField = "sch_full_nm";
            ddl.DataValueField = "sch_id";
            ddl.DataBind();
            ddl.Items.Insert(0, new ListItem("Select", "0"));
        }
        public void PopulateSchoolsCheckbox(ref CheckBoxList chk)
        {
            OpenSISWCFServiceStaffClient OSClient = new OpenSISWCFServiceStaffClient();
            chk.Items.Clear();
            DataSet ds = null;
            ds = OSClient.PopulateSchoolsCheckbox();
            OSClient.Close();
            chk.DataSource = ds.Tables[0];
            chk.DataTextField = "sch_full_nm";
            chk.DataValueField = "sch_id";
            chk.DataBind();
        }
        public void PopulateGender(ref DropDownList ddl)
        {
            OpenSISWCFServiceStaffClient OSClient = new OpenSISWCFServiceStaffClient();
            ddl.Items.Clear();
            DataSet ds = null;
            ds = OSClient.PopulateGender();
            ddl.DataSource = ds.Tables[0];
            ddl.DataTextField = "gender_nm";
            ddl.DataValueField = "gender_id";
            ddl.DataBind();
            ddl.Items.Insert(0, new ListItem("Select", "0"));
        }
    }
}